/**
 * @ProjectName:designPatern
 * @Title: LazySingleton
 * @Package _01singlePattern
 * @Description: 懒汉式单例模式
 * @author SuShuChao
 * @date 2025/5/22 22:11
 * @version V1.0
 * Copyright (c) 2025, 2034279227@qq.com All Rights Reserved.
 */
package _01singlePattern;

/**
 * @author Ssc
 * @data 2025/5/22 22:11
 * @description: 懒汉式单例模式
 */
public class LazySingleton {
    private static LazySingleton instance;

    private LazySingleton() {}

    public static synchronized LazySingleton getInstance() {
        if (instance == null) {
            instance = new LazySingleton();
        }
        return instance;
    }
}
